home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / programming / c / smc2cweb / docs / c2cweb.doc next >
Encoding:
Text File  |  1996-09-07  |  5.7 KB  |  186 lines

  1.                        Amiga Port of c2cweb V1.4
  2.                        =========================
  3.  
  4. This program was written 1994 originally by Werner Lemberg. I have
  5. not made any changes to it in this port.
  6.  
  7. Source
  8. ------
  9. The only (and main) problem was to make the getopt() function which is
  10. not implemented for SAS/C (but for gcc). After reading the gcc-manual
  11. I understood that it is used similar to ReadArgs for CLI-Commands but
  12. uses the Un*x style (-xyz option). So I searched a program which uses
  13. it and hoped it would use SAS/C as compiler. I found that GNUTar1.2
  14. did just this so I just copied it (getopt.c, getopt.h) from there and
  15. also added alloca.c to it (slight changes to alloca.c so I needed not
  16. to include the whole port.c from GNUTar). That was all I needed.
  17. I have tried it with a simple program and it seems to work fine.
  18.  
  19. I did not include the whole archive from CTAN:tex-archive/web/c_cpp/c2cweb
  20. directory. What I left out are the MS-DOS binaries and the changes to
  21. cweave (which are not needed for c2web anyway). If you're interested in
  22. this, you can get it directly from there. If you're not sure about it read
  23. the c2cweb.txt file in this directory.
  24.  
  25. If you want to recompile simply use the included SMakefile.
  26.  
  27. Purpose
  28. -------
  29. c2cweb will transform plain C or C++ code into a CWEB file to get a pretty
  30. formatted output. You will need the cweb package which can be found on
  31. Amnet as well (Aminet Set 2c or Aminet 9 CD) which contains the CTANGLE
  32. and the CWEAVE binaries. To include your C/C++ code into a LaTeX document
  33. simply use CWEAVE after having processed it with C2CWEB (which you can
  34. also use to make a .tex-file from c2cweb.w, i.e. a documentation for it).
  35. CTANGLE is only needed if you want to recreate c2cweb.c from c2cweb.w
  36.  
  37. Copying
  38. -------
  39.  
  40. This program is free software; you can redistribute it and/or modify it under
  41. the terms of the GNU General Public License version 2 as published by the
  42. Free Software Foundation.
  43.  
  44. This program is distributed in the hope that it will be useful, but
  45. WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  46. or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  47. for more details.
  48.  
  49. You should have received a copy of the GNU General Public License along with
  50. this program; if not, write to the Free Software Foundation, Inc.,
  51. 675 Mass Ave, Cambridge, MA 02139, USA.
  52.  
  53. Installation
  54. ------------
  55.  
  56. Simply copy C2CWEB to your favourite TeX binary directory. Then you have
  57. to copy compiler.w to your CWEBINPUTS path. If you want to process the
  58. example and/or you want to use german language you have to copy
  59. macros/c2cweb.ger into a directory of your TEXINPUTS path.
  60.  
  61. Usage
  62. -----
  63.  
  64. The only change the user has to do normally is to insert /*@@*/ starting an
  65. empty line outside of a comment or string before the first function block
  66. (normally main(){ ... }) in the C code. After this command c2cweb writes each
  67. function block into a section. Before /*@@*/ all stuff is written into a
  68. (possibly large) section. If you want to structure this further or if you have
  69. structure definitions between functions, use /*@*/ to start a new section
  70. without starting the function block algorithm (and of course /*@@*/ before the
  71. next function).
  72. The function algorithm simply counts paired braces; if none are open, a new
  73. section will begin.
  74. The file example.c has these control codes inserted already.
  75.  
  76.  
  77. The syntax is
  78.  
  79.     c2cweb [switches] csourcefile(s) | @responsefile(s)
  80.  
  81. The possible switches are:
  82.  
  83. -v:
  84.  
  85. all comments are written in typewriter type. You will need this if you have
  86. already formatted your comments, for example
  87.  
  88.             /********************/
  89.             /*    example.c     */
  90.             /********************/.
  91.  
  92. -t value:
  93.  
  94. all tabs will be expanded, and the -t switch defines the tab length (default
  95. value is 4).
  96.  
  97. -l:
  98.  
  99. causes all linefeeds inside of C text to be output explicitly by inserting
  100. @/ (a CWEB control code) at the end of each code line.
  101.  
  102. -o directory:
  103.  
  104. sets the output directory which must exist already.
  105.  
  106. -b "titlestring":
  107.  
  108. defines a title with the titlestring enclosed in double quotes. This string
  109. will be passed directly to \TeX.
  110.  
  111. -1:
  112.  
  113. one-sided output (i.e. left header is the same as right header).
  114.  
  115.  
  116. The last steps are calling CWEAVE with the transformed master file and then
  117. calling TeX to get a printable .dvi-file.
  118.  
  119.  
  120. An example:
  121.  
  122.     your input files are
  123.         header1.h, header2.h, file1.c, file2.c, file3.c
  124.  
  125.     you must call then
  126.         c2cweb [options] header*.h file*.c
  127.  
  128.     to get the *.*w files. c2cweb will now process your files and tell you
  129.     which file is the input file for CWEAVE (we'll assume file3.cw).
  130.  
  131.     After calling
  132.         cweave [options] file3.cw
  133.  
  134.     you get a .tex file (and some additional auxiliary files) which should be
  135.     processed further by PLAIN TeX (LaTeX is not supported):
  136.  
  137.         tex file3[.tex]
  138.  
  139.  
  140. Please read the `Hints and Tricks' section about enhancements and limitations
  141. of c2cweb in the file c2cweb.w (say `smake documentation' to build the .dvi
  142. file).
  143.  
  144. Author
  145. ------
  146.  
  147. Werner Lemberg (a7621gac@awiuni11.bitnet)
  148.  
  149. Please report any errors, comments or suggestions to this email-address.
  150.  
  151. N.B.: If you like this program, send me a postcard !
  152.  
  153.     Werner Lemberg
  154.     Goldschlagstr. 52/14
  155.  
  156.     A-1150 Vienna/Austria
  157.  
  158. Amiga-Port:
  159. -----------
  160.  
  161. E-MAIL (prefered):
  162. ------------------
  163.  
  164.   suamor@student.uni-tuebingen.de
  165.  
  166. SnailMail:
  167. ----------
  168.  
  169.   Reinhard Katzmann
  170.   Schellingstraße 41
  171.  
  172.   D - 72072 Tübingen
  173.  
  174. BBS'es
  175. ------
  176.  
  177. You can try to reach me through BBS'es near Tübingen. Some of the Sysops
  178. might know me or have contact to the Internet. I'm only User of one BBS:
  179.  
  180. Onkel Helmut's Hütte
  181.  
  182. Line 1: (0049) +7157/64546 (28800 Baud)
  183. Line 2: (0049) +7157/65428 (14400 Baud)
  184.  
  185. My usual Nickname on the internet or at this BBS is Suamor.
  186.